home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************
- * 外部CCI の呼び出し
- *************************************************************************/
-
- char *_cci_exp_ = "cci.exp";
- char cci_cci_option[256] = {0};
- char cci_usr_option[256] = {0};
-
- int cci_call( char *_pn )
- {
- int ret, drv;
- char tmp[256], pn[256], fn[256], exfn[256];
- char *dlg;
-
- /* カレント変更 */
- drv = toupper(pn[0]) - 'A';
- FS_chdrv(drv);
- FS_getDnamPath(tmp,pn);
- FS_chdir(tmp);
-
- /* CPP ------------------------------------------------------------*/
- FS_unix2dos(pn, _pn);
- FS_getFnam(fn,pn);
- FS_appendSnam( exfn, fn, "._ci" );
- sprintf( tmp, "cpp -D__CCI__ %s > %s", pn, exfn );
- dlg = DLG_msgOpen( DLGPOS_CENTER_OF_SCN, DLGPOS_CENTER_OF_SCN,
- 80*6, 14*12, C_MBLACK, C_DLGBASE, COLMIX(C_INFO,C_GRAY),
- "CPP" );
- if ( dlg )
- {
- DLG_msgSetConfig( dlg, 4, 6, 12 );
- DLG_msgClear( dlg, -1 );
- DLG_msgConsSet( dlg, C_MBLACK, C_HWHITE); /* コンソール出力設定 */
- }
- MOS_DEC();
- system( tmp );
- MOS_INC();
- if ( dlg )
- {
- DLG_msgPrintf(dlg,"\r\n***** COMPLETED *****\r\n");
- DLG_msgConsEnd( dlg );
- DLG_msgClose(dlg);
- }
-
- /* DTA 領域の設定 ------------------------------------------------*/
- AplDtaInit();
- AplDtaSetStr( "$MainArg", "%s %s %s -- %s", _cci_exp_, cci_cci_option, exfn, cci_usr_option );
-
- ret = AplPclExec( _cci_exp_, 7 );
-
- FS_getFnam(fn,pn);
- FS_appendSnam( fn, fn, ".mid" );
- #if 0
- if ( FS_isFileExist(fn) > 0 )
- MID_playStart( fn );
- #endif
-
- return (NORMAL);
- }
-
- int cci_call_menu( char *pn )
- {
- int ret;
- char tmp[256];
- char *dlg;
- char *mnu;
- char *obj;
- char *p;
-
- if ( pn[0] == '\0' )
- return (NORMAL);
-
- obj = MNU_alloc(4);
- MNU_setObj(obj, 0, MNU_NOR, 'S', "System option", NULL, 1, NULL, NULL);
- MNU_setObj(obj, 1, MNU_NOR, 'U', "User Option" , NULL, 2, NULL, NULL);
- MNU_setObj(obj, 2, MNU_BLK, 0 , NULL , NULL, 3, NULL, NULL);
- MNU_setObj(obj, 3, MNU_NOR, 'C', "Call CCI" , NULL, 4, NULL, NULL);
-
- mnu = MNU_open( DLGPOS_MOS_SET_HOME, DLGPOS_MOS_SET_HOME, MNUATT_EXIT,
- obj, "CCI" );
-
- for(;;)
- {
- ret = MNU_start ( mnu );
- switch ( ret )
- {
- case 1: /* system option */
- dlg = DLG_getsOpen( DLGPOS_MOS_SET_HOME, DLGPOS_MOS_SET_HOME, 320,
- "CCI のオプションパラメータを入力してください。");
- DLG_getsSetTitle( dlg, "CCI system option parameter" );
- strcpy( tmp, cci_cci_option);
- ret = DLG_getsStart( dlg, 255, tmp );
- if ( ret >= 0 )
- strcpy( cci_cci_option, tmp );
- DLG_getsClose(dlg);
- break;
-
- case 2: /* option */
- dlg = DLG_getsOpen( DLGPOS_MOS_SET_HOME, DLGPOS_MOS_SET_HOME, 320,
- "CCI のオプションパラメータを入力してください。");
- DLG_getsSetTitle( dlg, "CCI user option parameter" );
- strcpy( tmp, cci_usr_option);
- ret = DLG_getsStart( dlg, 255, tmp );
- if ( ret >= 0 )
- strcpy( cci_usr_option, tmp );
- DLG_getsClose(dlg);
- break;
-
- case 4: /* compile */
- cci_call( pn );
- goto _RET;
- default:
- goto _RET;
- }
- }
-
- _RET:
- MNU_close(mnu);
- MNU_free(obj);
- return (NORMAL);
- }
-